package com.self.engine.controller;

import com.self.common.response.R;
import com.self.engine.service.EntrustOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version v1.0
 * @ClassName: EntrustOrderController
 * @Description:
 * @Author: Mac
 */
@RestController
@RequestMapping("/entrustOrders")
@Api(tags = "委托记录")
public class EntrustOrderController {

    @Autowired
    private EntrustOrderService entrustOrderService;


    @ApiOperation(value = "委托单的取消操作")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id" ,value = "委托单的id")
    })
    @DeleteMapping("/{id}")
    public R deleteEntrustOrder(@PathVariable("id") Long orderId){
        entrustOrderService.cancleEntrustOrder(orderId) ;
        return R.ok("取消成功") ;
    }
}
